<?php
$special_order = (($order['Product']['inventory_on']) && ($order['Orderable']['inventory_start'] == 0) && ($current_user['auth_type'] != AUTH_CASH && $current_user['auth_type'] != AUTH_ADMIN)) ? true : false;

$basket = (isset($toBasket)) ? $toBasket : $current_user['member_id'];

if (!$special_order) {
?>
<form method='post' action='<?=$html->url('/orderables/order/' . $order['Orderable']['id']);?>'>
<?php
}
?>
<fieldset>
<legend>Order Item</legend>
<?=$form->hidden("BasketItem.member_id",array('value' => $basket));?>
<?=$form->hidden("BasketItem.orderable_id",array('value' => $order['Orderable']['id']));?>
<h3><?=$order['Product']['product_name'], ' (#', $order['Product']['product_id'], ')'?></h3>
<h4>Category: <?=$order['Subcategory']['subcategory_name']?></h4>
<?=$image->getImage($order,array('width'=>50));?>
<p><?=$html->link("About " . $order['Member']['business_name'] ,'/producers/about/' . $order['Product']['producer_id']);?></p>
<p class="description"><?=$order['Product']['detailed_notes']?></p>
<p><label for="Price">Price</label> $<?=number_format($order['Orderable']['price'],2) . ' per ' . $order['Orderable']['priced_by'];?></p>
<?php
if (!$special_order) {
?>
<?=$form->input('BasketItem.quantity',array('label' => 'Quantity in ' . $order['Orderable']['ordered_by'] . '(s)', 'class'=>'quantity','value'=>1));?>
<?php
	echo $form->submit('Add to Basket');
    echo '</form>';
} else {
	echo '<h4>Available by Special Order only</h4>';
}
//pr($order);
//pr($photos);
//pr($pic_error);
?>
<div class="photos">
<?php
foreach($photos as $photo) {
	echo $lightbox->img($photo['thumb'], $photo['medium'], $photo['title']);
}
?>
</div>
